package nl.ajonker.railroad.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import nl.ajonker.railroad.dl.Track;

public class TrainMover implements ActionListener {
	private final Track track;
	private final RailRoad railRoad;

	public TrainMover(Track track, RailRoad railRoad) {
		this.track = track;
		this.railRoad = railRoad;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		track.step();
		railRoad.repaintRails();
	}

}
